package com.mycompany.project.client;

public class GameData {
	// table data 0 is not used yet, 1 is cross, 2 is nought
	private int currentPlay=1;
	private int table []= {0,0,0,0,0,0,0,0,0};
	private boolean winnerX = false;
	private boolean winnerO = false;
	private int gameCount = 0;
		
	public boolean isWinnerX() {
		return winnerX;
	}
	public void setWinnerX() {
		this.winnerX = true;
	}
	public boolean isWinnerO() {
		return winnerO;
	}
	public void setWinnerO() {
		this.winnerO = true;
	}
	public int[] getTable() {
		return table;
	}
	public void setTable(int[] table) {
		this.table = table;
	}	
	public int getTableElement(int i){
		return table[i];
	}
	public void setTableElement(int i){
		table[i]=currentPlay;
	}
	public int getCurrentPlay() {
		return currentPlay;
	}
	public void setCurrentPlay(int currentPlay) {
		this.currentPlay = currentPlay;
	}
	public void resetGameData(){
		for(int i=0; i< table.length; i++){
			table[i]=0;
		}
		currentPlay=1;
		winnerX=false;
		winnerO=false;
		gameCount=0;
	}
	public int getGameCount() {
		return gameCount;
	}
	public void setGameCount(int gameCount) {
		this.gameCount = gameCount;
	}
	public void incGameCount(){
		gameCount++;
	}
	public void setWinnerX(boolean winnerX) {
		this.winnerX = winnerX;
	}
	public void setWinnerO(boolean winnerO) {
		this.winnerO = winnerO;
	}
	
	

}
